#include "arith_sort.h"

static void swap(rt_int32_t *value1, rt_int32_t *value2)
{
    rt_int32_t temp = *value1;
    *value1 = *value2;
    *value2 = temp;
}
void bubble_sort(rt_int32_t *array, rt_uint16_t size)
{
    for(rt_uint16_t i = 0; i < size - 1; i++)
    {
        for(rt_uint16_t j = i + 1; j < size; j++)
        {
            if(array[i] > array[j])
            {
                swap(&array[i], &array[j]);
            }
        }
    }
}
